<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<html>
<head>
<title>借款申请部门审批信息</title>
<%@include file="/common/ec.jsp"%>
<%@include file="/common/meta.jsp"%>
<style type="text/css">
.table {
	margin-top:1px;
	border-collapse: collapse;
	border-left-width: 0px;
	border-top-width: 0px;
}

.table tr th {
	background-color: #ECECEC;
	height:30px;
 	font-weight: bold;
 	font-size:13px;
 	text-align: center;
	border-bottom: 1px solid #000000;
	border-right: 1px solid #000000;
	font-family: sans-serif;
}

.table tr td {
	line-height: 25px;
	padding: 2px;
	font-family: sans-serif;
}
</style>
</head>
<body>
<div class="x-panel">
  <div class="x-panel-header" style="border-bottom: 1px solid #A9BFD3;">&nbsp;报销申请审批</div>
    <table border="0" align="center">
    <tr>
	  <td align="right" valign="top" style="padding-right: 5px;">
		 <table width="480" class="table" border="1" bordercolor="#000" cellpadding="0" cellspacing="0">
		<tr> 
           <th class="title" colspan="6">报销单</th>
        </tr>	
        <tr> 
           <td align="right" width="120">部门名称：</td>
           <td align="left" width="130">&nbsp;${model.flow.reimb.dept.name}</td>	 			
           <td align="right" width="70">制单日期：</td>
           <td align="left" colspan="3">&nbsp;<s:date name="model.flow.reimb.createDate" format="yyyy-MM-dd HH:mm"/></td>		
        </tr>           
        <tr> 
           <td align="right" >报销单号：</td>
           <td align="left" colspan="5">&nbsp;${model.flow.reimb.singleNo}</td>		
        </tr>         
        <tr> 
           <td align="right" >项目类别：</td>
           <td align="left">&nbsp;${model.flow.reimb.project.projectType.name}</td>
           <td align="right">项目名称：</td>
           <td align="left" colspan="3">&nbsp;${model.flow.reimb.project.name}</td>	 				
        </tr>  
        <s:if test="model.flow.reimb.singleType == 0 || model.flow.reimb.singleType == 1">       
        <tr> 
           <td align="right">销账金额：${model.flow.reimb.singleType}</td>
           <td align="left">&nbsp;<span style="color: green;">${model.flow.reimb.borrowAmount}</span></td>
           <td align="right" >余&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;款：</td>
           <td align="left" colspan="3">&nbsp;<span style="color: green;">${model.flow.reimb.balance}</span></td>					
        </tr>	
   
         <tr height="23" style="padding: 8px 2px;"> 
           <td align="right" >销账借款单号：</td>
           <td align="left" colspan="5">&nbsp;${model.flow.reimb.totalBorrowNos}</td>				
         </tr>
        
         <tr height="23" style="padding: 8px 2px;"> 
           <td align="right" >部分销账借款单号：</td>
           <td align="left" colspan="5">&nbsp;${model.flow.reimb.partBorrowNos}</td>			
         </tr> 
         </s:if>  	 
		 </table>		  

		  <table width="480" class="table" border="1" bordercolor="#000" cellpadding="0" cellspacing="0">
			<tr> 
	           <th align="center" colspan="6" height="30">
	             <div align="center" style="float: center;margin-top: 6px;font-weight: bold;font-size:13px;">报销单明细</div>
                 <div align="right" style="float: right;font-size:13px; font-weight: normal;" >[总额:${model.flow.reimb.amount}]</div>
	           </th>
	        </tr>			 
		    <tr style="background-color: #ECECEC;">
		      <td width="200" align="center">科目名称</td>
		      <td width="282" align="center">摘要</td>
		      <td width="100" align="center">金额</td>
		      <td width="90" align="center">外币金额</td>
		      <td width="92" align="center">外币币种</td>
		    </tr>
		    <s:iterator value="model.flow.reimb.reimbDetail" var="rd" >
		    <tr>
		      <td>&nbsp;${rd.item.name}【${rd.item.code}】</td>
		      <td>&nbsp;${rd.title}</td>
		      <td>&nbsp;${rd.amount}</td>
		      <td>&nbsp;${rd.exchangeAmount}</td>
		      <td align="center">
			    <s:if test='#attr.rd.currency != null'>
			      &nbsp;${rd.currency.name}
			    </s:if>&nbsp;
		      </td>
		    </tr>
		    </s:iterator>
		  </table>
  		

		  <s:form id="saveAuditResult" method="post">
		    <s:hidden name="model.id" id="nodeId"/>
		    <s:hidden name="financeNodeType"/>
			<table class="table" width="480" border="1" bordercolor="#000" cellpadding="0" cellspacing="0">
			  <tr>
			    <th colspan="4">报销单审核</th>
			  </tr>	
			  <tr>
				<td align="right" width="160" style="margin-left: 100px;">&nbsp;&nbsp;&nbsp;&nbsp;审&nbsp;&nbsp;核&nbsp;&nbsp;人：</td>
				<td align="left" width="135">
				    <stc:username></stc:username>
				    <s:if test="model.dept != null">【${model.dept.name}】</s:if>
				</td>
				<td align="right" width="70">审批时间：</td>
				<td align="left" width="120">
				  <s:date name="model.audDate" format="yyyy-MM-dd HH:mm"/>
				</td>
			  </tr>	  
			  <tr>
			    <td align="right">是否通过：</td>
			    <td colspan="3">
			    	<s:radio list="statusMap" id="status" name="model.status" onchange="setStatusValue(this.value)"  cssStyle="border:0px;"/> 
		            <font color="red">*</font>
		        </td>
			  </tr>
			  <tr>
			    <td align="right">具体意见：</td>
				<td align="left" colspan="3">
				  <textarea rows="5" id="descn" name="model.descn" style="width:350px;height: 65px;"></textarea>
			    </td>
			  </tr>
			</table>
	      </s:form>
		  <table width="450">
		    <tr>
		      <td align="center" >
			    <input type="button" value="查看" class="button" onclick="viewReimb('${model.flow.reimb.id}')"/>&nbsp;&nbsp;
                <input type="button" value="保存" class="button" onclick="return auditSave()"/>&nbsp;&nbsp;
				<input type="button" value="返回" class="button" onclick="javascript:history. back();" />
			  </td>
			</tr>
		 </table>				
	  </td>

	  <td align="left" valign="top"  style="padding-left: 2px; padding-top: 2px;">
		    <iframe name="iframe_selfReimb" id="iframe_selfReimb" width="360" height="220" src="${ctx}/reimb/selfIndex.do?reimberId=${model.flow.reimb.reimber.id}" frameborder="0" scrolling="no"></iframe><br>
            <s:if test="model.dept != null && model.isFinance eq 0">
              <iframe name="iframe_deptReimb" id="iframe_deptReimb" width="360" height="220" src="${ctx}/reimb/deptIndex.do" frameborder="0" scrolling="no"></iframe><br>
            </s:if>
            <s:elseif test="model.dept == null && model.isFinance eq 0">
              <iframe name="iframe_projectReimb" id="iframe_projectReimb" width="360" height="220" src="${ctx}/reimb/projectIndex.do?projectId=${model.flow.reimb.project.id}" frameborder="0" scrolling="no"></iframe><br>
            </s:elseif>
            <s:elseif test="model.dept == null && model.isFinance eq 1">
             <iframe name="iframe_financeReimb" id="iframe_financeReimb" width="360" height="220" src="${ctx}/reimb/financeIndex.do" frameborder="0" scrolling="no"></iframe>
            </s:elseif>
	  </td>
   </tr>
</table>
</div>

<script type="text/javascript">
var statusVal = null;
function setStatusValue(aValue) {
	statusVal = aValue;
}	
function auditSave() {
	var frm = document.getElementById("saveAuditResult");
	if (statusVal == null || statusVal == "") {
		alert("请您选择审批是否通过！");
		return false;
	}
	if (confirm("您确认要审批此报销申请单吗？")){	
		frm.action = 'saveAuditNode.do';
		frm.submit();
	}else {
		return false;
	}
}	

function viewReimb(reimbId) { 
	var url = '${ctx}/reimb/view.do?model.id=' + reimbId;
	var styles = "dialogWidth:800px; dialogHeight:565px; status:no; scroll:no; help:no";
	window.showModalDialog(url, null, styles);
}
</script>
</body>
</html>